#ifndef SHM_H_
#define SHM_H_

/*--------------------------------------------------------------------------*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include "error.h"

/*--------------------------------------------------------------------------*/

int openShm(int key, int size);

int createShm(int key, int size, int perms);

int delShm(int shmId);

int attachShmR(int shmId, void **ptr);

int attachShmRW(int shmId, void **ptr);

int detachShm(void *ptr);



int createMemShmR(int key, int size, int perms, void **ptr);

int createMemShmRW(int key, int size, int perms, void **ptr);

int openMemShmR(int key, int size, void **ptr);

int openMemShmRW(int key, int size, void **ptr);

int delCreatedMemShm(int shmId, void *ptr);

int delOpenedMemShm(void *ptr);

/*--------------------------------------------------------------------------*/

extern int errno;

/*--------------------------------------------------------------------------*/

#endif /*SHM_H_*/
